﻿using System;
using NUnit.Framework;
using ValidationFramework.Configuration.Fluent;
using Rhino.Mocks;

using System.Text.RegularExpressions;
using ValidationFramework.Reflection;
using ValidationFramework.Specifications.Tests.Helpers;
namespace ValidationFramework.Specs.Tests.Regex
{
	[TestFixture]
	public class RegexFluentConfigTests
	{
		class Car
		{
			public string ModelName { get; set; }
		}
		//[Test]
		//public void Should_Be_Configureable_With_Fluent_Interface()
		//{
		//    // Arrange
		//    Validation.Initialize();

		//    // Act
		//    Validation.ConfigurePolicyFor<Car>(x =>	
		//    {
		//        x.Ensure(y => y.ModelName)
		//            .MatchesPattern("Dane", RegexOptions.IgnoreCase);
		//    });

		//    // Assert
		//    var policy = Validation.GetValidationPolicy<Car>(x => x.ModelName);
		//    var ruleConfiguredFluently = policy.MemberScopeRules[0];

		//    Assert.AreEqual(typeof(MatchesRegexSpec), ruleConfiguredFluently.Specification.GetType());
		//    MatchesRegexSpec validator = (MatchesRegexSpec)ruleConfiguredFluently.Specification;
		//    Assert.AreEqual("Dane", validator.ValidationExpression);
		//    Assert.AreEqual(RegexOptions.IgnoreCase, validator.RegexOptions);
		//}
	}
}
